/*
 ============================================================================
 Name		: VibraMassagerSettingView.cpp
 Author	  : 
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CVibraMassagerSettingView implementation
 ============================================================================
 */
#include <aknviewappui.h>
#include "VibraMassagerSettingView.h"
#include "LemonAssistant.hrh"

CVibraMassagerSettingView::CVibraMassagerSettingView()
	{
	// No implementation required
	iContainer = NULL;
	}

CVibraMassagerSettingView::~CVibraMassagerSettingView()
	{
	DoDeactivate();
	}

CVibraMassagerSettingView* CVibraMassagerSettingView::NewLC()
	{
	CVibraMassagerSettingView* self = new (ELeave) CVibraMassagerSettingView();
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
	}

CVibraMassagerSettingView* CVibraMassagerSettingView::NewL()
	{
	CVibraMassagerSettingView* self = CVibraMassagerSettingView::NewLC();
	CleanupStack::Pop(); // self;
	return self;
	}

void CVibraMassagerSettingView::ConstructL()
	{
	BaseConstructL();
	}

TUid CVibraMassagerSettingView::Id() const
	{
	return TUid::Uid(ELemonAssistantAppViewVibraMassagerSetting);
	}

void CVibraMassagerSettingView::HandleCommandL(TInt aCommand)
	{
	switch (aCommand)
		{
		default:
			AppUi()->HandleCommandL(aCommand);
		}
	}

void CVibraMassagerSettingView::HandleStatusPaneSizeChange()
	{
	if (iContainer != NULL)
		iContainer->SetRect(ClientRect());
	}

/**
 * 
 * */
void CVibraMassagerSettingView::DoActivateL(const TVwsViewId& /*aPrevViewId*/,
		TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
	{
	if (iContainer == NULL)
		{
		iContainer = CVibraMassagerSettingList::NewL();

		iContainer->SetMopParent(this);
		//iContainer->ConstructFromResourceL();
		AppUi()->AddToStackL(*this, iContainer);

		iContainer->MakeVisible(ETrue);
		iContainer->SetRect(ClientRect());
		iContainer->ActivateL();

		//add your init code ...

		}
	}
void CVibraMassagerSettingView::DoDeactivate()
	{
	if (iContainer != NULL)
		{
		AppUi()->RemoveFromViewStack(*this, iContainer);
		delete iContainer;
		iContainer = NULL;
		}
	}
